local nuzhan = fk.CreateSkill {

  name = "joy__nuzhan",

  tags = { Skill.Compulsory, },

}



nuzhan:addEffect(fk.PreCardUse, {
  name = "joy__nuzhan",
  anim_type = "offensive",
  frequency = Skill.Compulsory,
  events = {fk.PreCardUse},
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(nuzhan.name, false, true) and data.card and data.card.trueName == "slash" and
      data.card:isVirtual() and #data.card.subcards == 1 then
        return Fk:getCardById(data.card.subcards[1]).type == Card.TypeTrick or Fk:getCardById(data.card.subcards[1]).type ~= Card.TypeTrick
    end
  end,
  on_use = function(self, event, target, player, data)
    if Fk:getCardById(data.card.subcards[1]).type ~= Card.TypeTrick then
      player.room:addPlayerMark(player,"joy__nuzhan-turn",1)
    else
      data.additionalDamage = (data.additionalDamage or 0) + 1
    end
  end,
})

nuzhan:addEffect("targetmod", {
  name = "#joy__nuzhan_targetmod",
  residue_func = function(self, player, skill, scope)
    if skill.trueName == "slash_skill" and scope == Player.HistoryPhase then
      return player:getMark("joy__nuzhan-turn")
    end
  end,
})

return nuzhan